package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.Image;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.ImageManager;

public class ImageManagerImpl extends AbstractManager implements ImageManager {

	@Override
	public void addImage(Image image) {
		
		getHibernateTemplate().save(image);
	}

	@Override
	public void delImageById(String id) {

		getHibernateTemplate().delete(findImageById(id));
	}

	@Override
	public Image findImageById(String id) {
	
		return (Image)getHibernateTemplate().load(Image.class, id);
	}

	@Override
	public void updateImage(Image image) {

		getHibernateTemplate().update(image);
	}

	@Override
	public PagerModel findAllImages() {

		return searchPaginate("select i from Image i");
	}

}
